package com.apes.fn.scm.merchant.disbursement.repository;

import com.apes.fn.scm.merchant.disbursement.model.Disbursement;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
 * @author cyy
 */
public interface DisbursementRepository extends CustomRepository<Disbursement, String> {

    @Query("SELECT A AS merchant,B AS bank FROM MerchantAccountSettlement A,MerchantBankAccount B WHERE B.merchantSettlement.id = A.id AND A.id = :settlementId AND B.id = :bankId ")
    Map findBySettlementAndBank(@Param("settlementId") String settlementId, @Param("bankId") String bankId);
}
